package com.coocaa.internship.controller;

import com.coocaa.internship.common.ResultData;
import com.coocaa.internship.pojo.PositionCollection;
import com.coocaa.internship.service.serviceImpl.PositionCollectionServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author :hhd
 * @Description:
 * @date :2019/8/9 11:11
 */

@Controller
@RequestMapping("/positionCollection")
public class PositionCollectionController {

    @Autowired
    PositionCollectionServiceImpl positionCollectionService;

    @RequestMapping(value = "/insert", method = RequestMethod.POST)
    @ResponseBody
    public ResultData insertPositionCollection(PositionCollection positionCollection) {
        return positionCollectionService.insertPositionCollection(positionCollection);
    }


    @RequestMapping(value = "/select", method = RequestMethod.GET)
    @ResponseBody
    public ResultData selectPositionCollectionByUserId(@RequestParam("userId") Long userId) {
        return positionCollectionService.selectPositionCollectionByUserId(userId);
    }

    @RequestMapping(value = "/delete", method = RequestMethod.POST)
    @ResponseBody
    public ResultData deletePositionCollectionById(PositionCollection positionCollection) {
        return positionCollectionService.deletePositionCollectionById(positionCollection);
    }
}
